//
//  DetailHead.m
//  PTravel
//
//  Created by dllo on 15/11/24.
//  Copyright © 2015年 李涵. All rights reserved.
//

#import "DetailHead.h"

@implementation DetailHead

- (void)dealloc
{
    [_image release];
    [_bgImage release];
    [_view release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changColor) name:@"night" object:nil];
        [self createSubViews];
    }
    return self;
}

- (void)changColor
{
    self.backgroundColor = CELLCOLOR;
}
- (void)createSubViews
{
    
    self.bgImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, BOUNDS.size.width, 200)];
    self.bgImage.backgroundColor = [UIColor redColor];
    
    [self addSubview:self.bgImage];
    [_bgImage release];
    
    self.view = [[UIView alloc] initWithFrame:CGRectMake(0, 140, BOUNDS.size.width, 60)];
    self.view.backgroundColor = CELLCOLOR;
    [self addSubview:self.view];
    [_view release];
    
    self.image = [[UIImageView alloc] initWithFrame:CGRectMake(20, 120, 60, 60)];
    self.image.backgroundColor = [UIColor cyanColor];
    [self addSubview:self.image];
    [_image release];
    
    self.backgroundColor = CELLCOLOR;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
